package com.projectnection.server.webservices;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.repackaged.org.json.JSONArray;
import com.projectnection.server.database.entities.ListEntities;

@SuppressWarnings("serial")
public class ListEntitiesServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws IOException {

		JSONArray entities = ListEntities.jsonList();

		String answer = Utilities.getCallback(request.getParameter("callback"),
				entities.toString());

		response.setContentType("text/javascript");

		response.getWriter().println(answer);
	}
}
